<?php

use yii\helpers\Html;
use backend\assets\AppAsset;

//AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<html>
<head>
  <meta charset="<?= Yii::$app->charset ?>">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <title>广西中等职业学校学生信息管理系统</title>
  <?php $this->registerCsrfMetaTags() ?>
  <?php $this->head() ?>
  <link rel="stylesheet" href="lib/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="lib/layuiadmin/style/admin.css" media="all">  
</head>
<body class="layui-layout-body">
<?php $this->beginBody() ?>
  
  <div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
      <div class="layui-header">
        <!-- 头部区域 -->
        <ul class="layui-nav layui-layout-left">
          <li class="layui-nav-item layadmin-flexible" lay-unselect>
            <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
              <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
            </a>
          </li>
          <li id="breadcrumb" class="layui-breadcrumb" lay-filter="breadcrumb" lay-separator="/" style="visibility: visible;">
            <a lay-href="/graduation-audit/index">广西中职学生信息管理</a>
          </li>
        </ul>
        
        <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">   
          <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;" layadmin-event="refresh" title="刷新">
              <i class="layui-icon layui-icon-refresh-3"></i>
            </a>
          </li>      
          <!-- <li class="layui-nav-item" lay-unselect>
            <a href="school.html" layadmin-event="refresh" title="学校版">
              <i class="layui-icon layui-icon-link"></i>
            </a>
          </li> -->
          <!-- <li class="layui-nav-item" lay-unselect>
            <a lay-href="demo/views/app/message/index.html" layadmin-event="message" lay-text="消息中心" title="消息">
              <i class="layui-icon layui-icon-email"></i>  
              <span class="layui-badge-dot"></span>
            </a>
          </li> -->
          <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event="note" title="备忘录">
              <i class="layui-icon layui-icon-note"></i>
            </a>
          </li>
          <li class="layui-nav-item" style="margin-right: 15px;" lay-unselect>
            <a href="javascript:;">
              <img src="img/admin.jpg" class="layui-nav-img" style="border: 1.5px solid #000;">
              <cite><?= $model->username ?></cite>
            </a>
            <dl class="layui-nav-child">
              <!-- <dd><a lay-href="demo/views/set/user/info.html">账号设置</a></dd> -->
              <dd><a lay-href="/site/password?id=<?= Yii::$app->user->id ?>">修改密码</a></dd>
              <hr>
              <dd layadmin-event="logout" style="text-align: center;">
                <?= Html::beginForm(['/site/logout'], 'post').
                    Html::submitButton('退出', ['class' => 'btn btn-link logout']).
                    Html::endForm() ?>
              </dd>
            </dl>
          </li>          
        </ul>
      </div>
      
      <!-- 侧边菜单 -->
      <div class="layui-side layui-side-menu">
        <div class="layui-side-scroll">
          <div class="layui-logo" style="background-image: none;" lay-href="/school/index">
            <span>广西中职学生信息管理</span>
          </div>
          
          <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
            <li data-name="home" class="layui-nav-item">
              <a lay-href="/school/index" lay-tips="学校管理" lay-direction="2">
                <i class="layui-icon layui-icon-home"></i>
                <cite>学校管理</cite>
              </a>
            </li>
            <li data-name="template" class="layui-nav-item">
              <a lay-href="/teacher/index" lay-tips="教师管理" lay-direction="2">
                <i class="layui-icon layui-icon-user"></i>
                <cite>教师管理</cite>
              </a>
            </li>
            <li data-name="component" class="layui-nav-item">
              <a href="javascript:;" lay-tips="课程管理" lay-direction="2">
                <i class="layui-icon layui-icon-read"></i>
                <cite>课程管理</cite>
              </a>
              <dl class="layui-nav-child">
                <dd data-name="button">
                  <a lay-href="/term-course/index">开课查询</a>
                </dd>
                <dd data-name="nav">
                  <a lay-href="/elective/index">选修查询</a>
                </dd>
              </dl>
            </li>
            <li data-name="template" class="layui-nav-item">
              <a lay-href="/person/index" lay-tips="人员档案" lay-direction="2">
                <i class="layui-icon layui-icon-file-b"></i>
                <cite>人员档案</cite>
              </a>
            </li>
            <li data-name="home" class="layui-nav-item">
              <a lay-href="/major/index" lay-tips="专业管理" lay-direction="2">
                <i class="layui-icon layui-icon-app"></i>
                <cite>专业管理</cite>
              </a>
            </li>
            <li data-name="app" class="layui-nav-item">
              <a href="javascript:;" lay-tips="学籍管理" lay-direction="2">
                <i class="layui-icon layui-icon-tabs"></i>
                <cite>学籍管理</cite>
              </a>
              <dl class="layui-nav-child">   
                <dd data-name="content">
                  <a lay-href="/student-status/index">学籍查重</a>
                </dd>
                <dd data-name="content">
                  <a lay-href="/student-status/change">学籍异动</a>
                </dd> 
                <!-- <dd data-name="content">
                  <a lay-href="demo/views/senior/echarts/bar.html">学籍统计</a>
                </dd> -->
              </dl>
            </li>
            <li data-name="senior" class="layui-nav-item">
              <a href="javascript:;" lay-tips="毕业管理" lay-direction="2">
                <i class="layui-icon layui-icon-template-1"></i>
                <cite>毕业管理</cite>
              </a>
              <dl class="layui-nav-child">
                <dd><a lay-href="/graduation-audit/index">毕业资格审核</a></dd>
                <dd><a lay-href="/diploma/index">毕业证管理</a></dd>
              </dl>
            </li>
          </ul>
        </div>
      </div>

      <!-- 页面标签 -->
      <div class="layadmin-pagetabs" id="LAY_app_tabs">
        <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-down">
          <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
            <li class="layui-nav-item" lay-unselect>
              <a href="javascript:;"></a>
              <dl class="layui-nav-child layui-anim-fadein">
                <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
              </dl>
            </li>
          </ul>
        </div>
        <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
          <ul class="layui-tab-title" id="LAY_app_tabsheader">
            <li lay-id="school/index" lay-attr="school/index" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
          </ul>
        </div>
      </div>
      
      <!-- 主体内容 -->
      <div class="layui-body" id="LAY_app_body">
        <div class="layadmin-tabsbody-item layui-show">
          <iframe src="school/index" frameborder="0" class="layadmin-iframe"></iframe>
        </div>
      </div>
      
      <!-- 辅助元素，一般用于移动设备下遮罩 -->
      <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
  </div>

  <script src="lib/layuiadmin/layui/layui.js"></script>
  <script>
  layui.config({
    base: 'lib/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use('index');
  </script>
  
  <style>
    .layui-nav .layui-breadcrumb{display:inline-block;height:50px;line-height:50px;vertical-align: middle}
    .layui-nav .layui-breadcrumb a{display:inline-block}
    .layui-nav-item .btn-link{
        border-color: transparent;
        background-color: transparent;
        box-shadow: none;
        cursor: pointer;
    }
  </style>
  <!-- 面包屑导航脚本 -->
  <script>
    window.onload = function() {
      let breadcrumb = document.querySelector('#breadcrumb');
      let breadcrumbItems = document.querySelectorAll('#breadcrumb a');
      let sideItems = document.querySelectorAll('#LAY-system-side-menu a');

      sideItems.forEach(item => {
        item.addEventListener('click', function() {
          // 每次更新面包屑先清空里面的内容
          breadcrumb.innerHTML = '';
          // 根层
          let rootbreadcrumbItem = document.createElement('a');
          rootbreadcrumbItem.appendChild(document.createTextNode('广西中职学生信息管理'));
          // 将根层添加进面包屑组件
          breadcrumb.appendChild(rootbreadcrumbItem);
          if(this.querySelector('cite')) {
            // 分割线
            let separator = document.createElement('span');
            separator.appendChild(document.createTextNode('/'));
            separator.setAttribute('lay-separator', true);

            let thisTitle = this.querySelector('cite').innerHTML;
            let breadcrumbItem = document.createElement('a');
            breadcrumbItem.appendChild(document.createTextNode(thisTitle));

            breadcrumb.appendChild(separator);
            breadcrumb.appendChild(breadcrumbItem);
          } else {
            let thisTitle = this.innerHTML;
            let parentTitle = this.parentNode.parentNode.previousElementSibling.innerText;
            [parentTitle, thisTitle].forEach(item => {
              let separator = document.createElement('span');
              separator.appendChild(document.createTextNode('/'));
              separator.setAttribute('lay-separator', true);

              let breadcrumbItem = document.createElement('a');
              breadcrumbItem.appendChild(document.createTextNode(item));

              breadcrumb.appendChild(separator);
              breadcrumb.appendChild(breadcrumbItem);
            })
          }
        })
      })
    }
</script>
    
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>


